package com.leng.service.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.leng.mapper.AccessControlDeviceMapper;
import com.leng.entity.AccessControlDevice;
import com.leng.service.AccessControlDeviceService;

import java.util.List;

/**
* @Author: 冷俊杰
* @Description: TODO
* @DateTime: 2022/7/18 14:26
**/
@Service
public class AccessControlDeviceServiceImpl implements AccessControlDeviceService{

    @Resource
    private AccessControlDeviceMapper mapper;

    public PageInfo<AccessControlDevice> pageInfo(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<AccessControlDevice> accessControlDevices = mapper.listAccessControlDevice();
        PageInfo<AccessControlDevice> pageInfo = new PageInfo<AccessControlDevice>(accessControlDevices);
        return pageInfo;
    }

    public int deleteAccessControlDevice(Integer id) {
        return mapper.deleteAccessControlDevice(id);
    }

    public int addAccessControlDevice(AccessControlDevice accessControlDevice) {
        return mapper.addAccessControlDevice(accessControlDevice);
    }

    public int updateAccessControlDevice(AccessControlDevice accessControlDevice) {
        return mapper.updateAccessControlDevice(accessControlDevice);
    }
}
